package com.hsmw.api.mapper;

import cn.hutool.json.JSONObject;
import com.hsmw.api.vo.*;
import com.hsmw.common.base.BaseMapper;
import com.hsmw.domain.HsmwDriverOrderRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 车辆订单记录表 Mapper 接口
 * </p>
 *
 * @author wd
 * @since 2021-09-02
 */
public interface HsmwDriverOrderRecordMapper extends BaseMapper<HsmwDriverOrderRecord> {

    List<HsmwDriverOrderRecord> findDriverOrderListByDriverId(String key, String month);

    List<HomeVolume> findReachVolumeByDriverId(@Param("id") String id,@Param("year") String year,@Param("month") String month);

    List<HomeVolume> findSettlementVolumeByDriverId(@Param("id") String id,@Param("year")String year,@Param("month") String month);

    List<HsmwDriverOrderRecord> findDriverCountAndDriverId(String params);

    String findSettlementVolumesById(@Param("id") String id, @Param("month") String month);

    List<MoveAndRunVO> queryDriverOrderList(@Param("id") String id,@Param("month") String month);

    String queryDriverSumVolumeById(@Param("id") String id,@Param("format")  String format);

    Integer queryOrderCount(@Param("id") String id, @Param("format") String format);

    List<HomeVolume>  findReachVolumeByDriverIdOnYear(@Param("year") String year, @Param("id") String id);

    List<HomeVolume> findReachVolumeByDriverIdOnSection(@Param("id") String id, @Param("startTime") String startTime, @Param("endTime") String endTime);

    String findDriverOrderListRealVolumeById(@Param("driverLineChart") DriverLineChart driverLineChart);

    List<VehicleInfoByTypeDTO> findDriverOrderListVehicleById(@Param("driverLineChart")DriverLineChart driverLineChart);

    String findDriverWorkTimeById(@Param("driverLineChart") DriverLineChart driverLineChart);

    List<ItemFroDriverDTO> findDriverOrderOnItemInfoById(@Param("driverLineChart") DriverLineChart driverLineChart);

    Integer findDriverOrderOncompleteCount(@Param("driverLineChart")  DriverLineChart driverLineChart);

    List<HomeVolume> findYearList(String year);

    /**
     * 查询该公司订单完成数量
     * @param ownCompanyId
     * @return
     */
    int queryOrderCountByCompanyId(String ownCompanyId);

    /**
     * 查询该公司的实际完成方量信息
     * @param ownCompanyId
     * @return
     */
    Double queryRealVolumeByCompanyId(String ownCompanyId);
}
